package com.learn.file;

import com.google.common.collect.Lists;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;

/**
 * @author : Yu.Tan
 * @date : 2022/12/28 15:25
 * @desc : **
 *
 * SELECT id as '订单号',create_time as '下定时间',order_merge_status_name as '订单状态',model_name as '车型',customer_name as '客户姓名',customer_mobile_phone as '客户手机号码' FROM tt_sales_order WHERE brand_code=7 and create_time >='2021-04-01' and create_time <='2022-11-30' and customer_mobile_phone IN
 */
public class PhoneDemo {
//    public static void main(String[] args) {
//        File file = new File("C:\\Users\\谭羽\\Desktop\\phone-tank.txt");
//        try {
//            List<String> lines = FileUtils.readLines(file);
//
//            lines = lines.stream().distinct().collect(Collectors.toList());
//
//            List<List<String>> partition = Lists.partition(lines, 8000);
//           int index=0;
//            for (List<String> list : partition) {
//                String s = list.stream().collect(Collectors.joining(","));
//               s= "(" + s+ ")";
//                System.out.println("手机号码= "+ index ++ + s);
//            }
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//    }

//    private static final ExecutorService threadPool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 2);
//
//    public static void main(String[] args) {
//        for (int i = 0; i < 100; i++) {
//            try {
//                threadPool.submit(()->{
//                    System.out.println("循环"+Thread.currentThread().getName());
//                }).get();
//            } catch (Exception e) {
//                e.printStackTrace();
//            }
//        }
//
//        System.out.println("循环结束");
//    }


    public static void main(String[] args) {

        //返回 JVM 堆大小
        long initalMemory = Runtime.getRuntime().totalMemory() / 1024 /1024;
        //返回 JVM 堆的最大内存
        long maxMemory = Runtime.getRuntime().maxMemory() / 1024 /1024;

        System.out.println("-Xms : "+initalMemory + "M");
        System.out.println("-Xmx : "+maxMemory + "M");

        System.out.println("系统内存大小：" + initalMemory * 64 / 1024 + "G");
        System.out.println("系统内存大小：" + maxMemory * 4 / 1024 + "G");
    }
}
